Add sample filter skeleton.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 1 Aug 2005 06:33:27 +0000 (06:33 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 1 Aug 2005 06:33:27 +0000 (06:33 +0000)
gpsbabel/filter_skeleton.c [new file with mode: 0644]

diff --git a/gpsbabel/filter_skeleton.c b/gpsbabel/filter_skeleton.c
new file mode 100644 (file)
index 0000000..abff8df
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+
+    Filter skeleton: 
+    
+    Simple copy this file to <your_filter_name>.c and 
+    rename all filter_skeleton tokens to <your_filter_name>. Replace 
+    the stupid name and address in the Copyright few lines below.
+    To active your new filter you have to create a new section in 
+    filter_vecs and finally add complying statements to Makefile.
+
+    Copyright (C) YYYY John Doe, anybody@wherever.com
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA
+
+ */
+#include "defs.h"
+#include <ctype.h>
+
+#define MYNAME "filter_skeleton"
+
+
+// Any arg in this list will appear in command line help and will be 
+// populated for you.
+static
+arglist_t filter_skeleton_args[] = {
+// {"foo", &fooopt, "The text of the foo option in help", 
+//   "default", ARGYTPE_STRING} , 
+       {0, 0, 0, 0, 0}
+};
+
+/*******************************************************************************
+* %%%        global callbacks called by gpsbabel main process              %%% *
+*******************************************************************************/
+
+static void
+filter_skeleton_init(const char *args)         /* optional */
+{
+}
+
+static void 
+filter_skeleton_process(void)  /* this procedure must be present in vecs */
+{
+// Here is how you register callbacks for all waypoints, routes, tracks.
+// waypt_disp_all(waypt)
+// route_disp_all(head, tail, rtept);
+// track_disp_all(head, tail, trkpt);
+}
+
+static void
+filter_skeleton_deinit(void)           /* optional */
+{
+}
+
+/*******************************************************************************/
+
+filter_vecs_t filter_skeleton_vecs = {
+       filter_skeleton_init,
+       filter_skeleton_process,
+       filter_skeleton_deinit,
+       NULL,
+       filter_skeleton_args
+};
+
+/*******************************************************************************/